import java.io.IOException;

public class SystemMethod {
    public static void main(String[] args) throws IOException, InterruptedException {
        Runtime runtime = Runtime.getRuntime();
        Process process = runtime.exec("D:\\WXWork\\WXWork.exe");
        //打开程序
        Thread.sleep(3000);
        //程序会在这里暂停5秒，之后往下走。
        process.destroy();
        //销毁程序，即退出
    }
/*        long i = runtime.totalMemory();
        System.out.println(i/1024/1024.0+"MB");

        long a = runtime.freeMemory();
        System.out.println(a / 1024 / 1024.0 + "MB");

    }*/
/*        long i = runtime.totalMemory();
        System.out.println(i/1024/1024.0+"mb");
    }*/
/*        Runtime runtime = Runtime.getRuntime();
        int a = runtime.availableProcessors();
        System.out.println(a);
    }*/
/*
        Runtime runtime = Runtime.getRuntime();
        runtime.exit(0);
        System.out.println("执行当前代码");
    }
*/

/*
        Runtime runtime = Runtime.getRuntime();
        System.out.println(runtime);
    }
*/

/*        long a = System.currentTimeMillis();
        System.out.println(a);

        for (int i = 0; i < 100000; i++) {
            System.out.println(1);
        }
        long b = System.currentTimeMillis();

        System.out.println("该程序运行了 " + (b-a)/1000.0 + "s");
    }*/
/*        System.exit(0);
        System.out.println("运行这行代码");
    }*/
}
